// Copyright Leonid Shlyapnikov 2010
// Distributed under the GNU Lesser General Public License http://www.gnu.org/licenses/lgpl.html
//    author: Leonid Shlyapnikov, created on: Feb 1, 2010

#include <boost/test/included/unit_test.hpp>

void MemoryArea_allocate();
void MemoryArea_assert_contains();
void MemoryArea_allocateShouldReturnZero();
void MemoryArea_multipleAllocates();
void MemoryArea_allocateRawData();
void MemoryArea_allocateShowThrowInvalidArgument();
void MemoryArea_createField();
void MemoryArea_createFieldShouldThrowBadAlloc();
void MemoryArea_reset();

void FixMessage_isFieldIndexed();
void FixMessage_8_9_35_PredefinedOrder();
void FixMessage_createEmptyMessage();
void FixMessage_createMessage();
void FixMessage_writeTo();
void FixMessage_setChecksum1();
void FixMessage_setChecksum2();
void FixMessage_setBodyLength1();
void FixMessage_setAll();
void FixMessage_accessRepeatingGroup();

void Field_create();
void Field_resetTagShort();
void Field_resetTagLong();
void Field_resetTagLongThanShort();
void Field_setTagFromMemoryArea();
void Field_writeTo();

void Vector_iterator();
void FieldList_push_back();
void FieldList_erase_first();
void FieldList_erase_last();
void FieldList_erase_in_the_middle();
void FieldList_out_of_range_erase();
void FieldList_empty();
void FieldList_operators();

void String_assign();
void String_MemoryAreaAllocateAssign();
void String_assign2();
void String_reassign();
void String_reassign2();
void String_assign_std_string();

void ChecksumConverter_test();

void define_msg_macro_tag_hash_test();

void Uint32ToStringConverter_test_toString();


#define ADD_TEST(test_function) \
    master_test_suite().add(BOOST_TEST_CASE( test_function )) \


boost::unit_test::test_suite*
init_unit_test_suite(int, char**) {
    using boost::unit_test::framework::master_test_suite;

    ADD_TEST( &MemoryArea_allocate );
    ADD_TEST( &MemoryArea_assert_contains );
    ADD_TEST( &MemoryArea_allocateShouldReturnZero );
    ADD_TEST( &MemoryArea_multipleAllocates );
    ADD_TEST( &MemoryArea_allocateRawData );
    ADD_TEST( &MemoryArea_allocateShowThrowInvalidArgument );
    ADD_TEST( &MemoryArea_createField );
    ADD_TEST( &MemoryArea_createFieldShouldThrowBadAlloc );
    ADD_TEST( &MemoryArea_reset );

    ADD_TEST( &FixMessage_isFieldIndexed );
    ADD_TEST( &FixMessage_8_9_35_PredefinedOrder );
    ADD_TEST( &FixMessage_createEmptyMessage );
    ADD_TEST( &FixMessage_createMessage );
    ADD_TEST( &FixMessage_writeTo );
    ADD_TEST( &FixMessage_setChecksum1 );
    ADD_TEST( &FixMessage_setChecksum2 );
    ADD_TEST( &FixMessage_setBodyLength1 );
    ADD_TEST( &FixMessage_setAll );
    ADD_TEST( &FixMessage_accessRepeatingGroup );

    ADD_TEST( &Field_create );
    ADD_TEST( &Field_resetTagShort );
    ADD_TEST( &Field_resetTagLong );
    ADD_TEST( &Field_resetTagLongThanShort );
    ADD_TEST( &Field_setTagFromMemoryArea );
    ADD_TEST( &Field_writeTo );

    ADD_TEST( &Vector_iterator );
    ADD_TEST( &FieldList_push_back );
    ADD_TEST( &FieldList_erase_first );
    ADD_TEST( &FieldList_erase_last );
    ADD_TEST( &FieldList_erase_in_the_middle );
    ADD_TEST( &FieldList_out_of_range_erase );
    ADD_TEST( &FieldList_empty );
    ADD_TEST( &FieldList_operators );

    ADD_TEST( &String_assign );
    ADD_TEST( &String_MemoryAreaAllocateAssign );
    ADD_TEST( &String_assign2 );
    ADD_TEST( &String_reassign );
    ADD_TEST( &String_reassign2 );
    ADD_TEST( &String_assign_std_string );

    ADD_TEST( &ChecksumConverter_test );

    ADD_TEST( &define_msg_macro_tag_hash_test );

    ADD_TEST( &Uint32ToStringConverter_test_toString );

    return 0;
}

#undef ADD_TEST
